﻿@model Cofoundry.Web.Admin.Internal.ForgotPasswordViewModel
@inject IStaticResourceReferenceRenderer staticResourceReferenceRenderer
@inject IAdminRouteLibrary adminRouteLibrary

@{
    ViewBag.Title = "Forgotten password";
    Layout = adminRouteLibrary.Auth.LoginLayoutPath;
    var returnUrl = Context.Request.Query["ReturnUrl"];
    var loginUrl = adminRouteLibrary.Auth.Login(returnUrl);
}

@section FooterScripts
    {
    @staticResourceReferenceRenderer.ScriptTag(adminRouteLibrary.Auth, "Shared")
}

<h1>Forgotten your password?</h1>

<div class="wrap">
    @if (Context.Request.Method == "POST" && ViewData.ModelState.IsValid)
    {
        <form>
            <fieldset>

                <p>Instructions on how to reset your password have been sent to your email address.</p>

                <div class="actions">
                    <p id="forgotPasswordLink">
                        <a href="@loginUrl">Click here to login</a>
                    </p>
                </div>

            </fieldset>
        </form>
    }
    else
    {
        <form method="post" class="form-horizontal" id="MainForm">

            <fieldset>
                <p>Complete the form below to request a password reset.</p>
                <div class="control-group">
                    <label asp-for="Username" class="control-label"></label>
                    <div class="controls">
                        <input asp-for="Username" maxlength="128" , type="email" />
                        <span asp-validation-for="Username" class="help-block"></span>
                        <div asp-validation-summary="ModelOnly"></div>
                    </div>
                </div>

                <div class="actions">
                    <input type="submit" class="btn btn-primary" value="Reset password" />
                </div>

            </fieldset>
        </form>
    }
</div>

<footer class="login-footer">
    <p class="login-footer-links">
        <a id="loginLink" class="popup" href="@loginUrl">&lt; Back to login</a>
    </p>
</footer>